<?php

use yii\grid\GridView;
use yii\helpers\Html;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '分享记录';
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
    .share-index img{width:80px;height:80px;margin-right:10px;}
</style>
<div class="share-index">
    <?= $this->render('_search', ['model' => $searchModel]) ?>
    <div class="box box-primary">
        <div class="box-body">
            <?= GridView::widget([
                'dataProvider' => $dataProvider,
                'columns' => [
                    'id',
                    'uid',
                    'nick',
                    [
                    'attribute' => 'photo',
                    'format' => 'image',
                    'value'=>function($data) { return $data->photo; },
                    'options' => ['width' => '10%'],
                    ],
                    'toy_name',
                    [
                    'attribute' => 'toy_photo',
                    'format' => 'image',
                    'value'=>function($data) { return $data->toy_photo; },
                    'options' => ['width' => '10%'],
                    ],
                    'share_time',
                    'achievement_id',
                    [
                        'class' => 'yii\grid\ActionColumn',
                        'template' => ' {delete} ',
                        'buttons' => [
                            
                        ]
                    ],
                ],
            ]); ?>
        </div>
    </div>

</div>
<?php $this->beginBlock('js') ?>
<script>
    layer.ready(function () {
        layer.photos({
            photos:'.achievement-index',
            shift:5
        });
    })
</script>
<?php $this->endBlock() ?>
